package com.example.demo.repository;

import com.example.demo.entity.PersonView;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by pengwan on 2017/7/29.
 */
@Repository
public interface PersonViewRepository extends JpaRepository<PersonView, String> {

    @Query("select p.education as education, count(distinct p.sexAge) as numbers from PersonView p group by p.education")
    List<Map<String, Object>> test();
}

